package patterns.actions.strategy.example;

public class ContextClient {
	private DiscountStrategy dis;

	ContextClient(DiscountStrategy discount) {
		this.dis = discount;
	}

	public double clientCal() {
		return this.dis.cal();
	}

	public static void main(String[] args) {
		ContextClient cc = new ContextClient(new NoDiscountStrategy(50, 20));
		System.out.println("NO:"+cc.clientCal());
		cc= new ContextClient(new FixDiscountStrategy(50, 20)); 
		System.out.println("FIX:"+cc.clientCal());
		cc= new ContextClient(new PercentDiscountStrategy(50, 20)); 
		System.out.println("PERCENT:"+cc.clientCal());
	}

}
